package demo;

public class MyThread extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            //Thread.currentThread()获取当前线程对象    getName();  获取线程的名称
            System.out.println(Thread.currentThread().getName()+"----->"+i);
        }
    }
}
